home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / MotifApp / ch2 / Stopwatch2 / Control.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  1.9 KB  |  56 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. ////////////////////////////////////////////////////////////////////
  22. // Control.h: A start/stop pair of buttons for the stopwatch program
  23. ////////////////////////////////////////////////////////////////////
  24. #ifndef CONTROL_H
  25. #define CONTROL_H
  26. #include "BasicComponent.h"
  27.  
  28. class Timer;
  29. class Stopwatch;
  30.  
  31. class Control : public BasicComponent {
  32.     
  33.   private:
  34.     
  35.     void start();  // Called when the user hits the start button
  36.     void stop();   // Called when the user hits the stop button
  37.     
  38.     // Static member functions that interface the above member
  39.     // functions with Motif widget callbacks
  40.     
  41.     static void startCallback ( Widget, XtPointer, XtPointer );
  42.     static void stopCallback ( Widget, XtPointer, XtPointer );
  43.     
  44.   protected:
  45.     
  46.     Timer     *_timer;       // The timer controlled by this class
  47.     Stopwatch *_stopwatch;   // The stopwatch containing this control
  48.     Widget     _startWidget; // The start button
  49.     Widget     _stopWidget;  // Stop button
  50.     
  51.   public:
  52.     
  53.     Control ( Widget, char *, Stopwatch *, Timer * );
  54. };
  55. #endif
  56.